﻿using Newtonsoft.Json;

using PLCS.Shared.Common.Helper;
using PLCS.SocialHttpApi.WebServiceModels;

using System;
using System.Xml.Serialization;

namespace PLCS.SocialHttpApi.WebServiceControllers
{
    public class WebServiceExample : IWebServiceExample
    {
        public async Task<WebServiceExampleModel> WebServiceExampleService(TestBody data)
        {
            await Task.Delay(100);
            var response = new WebServiceExampleModel();
            string xmlString = XMLHelper.SerializeToXml(response);

            return response;
        }

        public Task<WebServiceExampleModel> WebServiceExampleService(string data)
        {
            throw new NotImplementedException();
        }

        public string WebServiceExampleServicewww(string data)
        {
            return "www";
        }
    }

    public partial class TestBody
    {
        [XmlElement("endtime")]
        public string Endtime { get; set; }

        [XmlElement("factory_code")]
        public string FactoryCode { get; set; }

        [XmlElement("gwid")]
        public string Gwid { get; set; }

        [XmlElement("readtimestart")]
        public string ReadtimeStart { get; set; }
    }
}